<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:mtg="http://www.patelski.myself/jsf"
	xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml">

	<ui:define name="body">

		<rich:panel>
			<f:facet name="header">Card</f:facet>
			<h:panelGrid columns="2" columnClasses="fifty,fifty">

				<h:panelGroup>
					<mtg:cardQuickPanel card="#{inventoryHome.instance.card}" />
				</h:panelGroup>
				<h:panelGroup style="width:100%;height:100%;">

					<rich:panel styleClass="quickPanel">
						<f:facet name="header">Inventory</f:facet>

						<s:decorate id="have" template="layout/display.xhtml">
							<ui:define name="label">Owned</ui:define>
							<h:outputText value="#{inventoryHome.instance.have}">
								<f:convertNumber />
							</h:outputText>
						</s:decorate>

						<s:decorate id="keep" template="layout/display.xhtml">
							<ui:define name="label">Keep</ui:define>
							<h:outputText value="#{inventoryHome.instance.keep}">
								<f:convertNumber />
							</h:outputText>
						</s:decorate>

						<s:decorate id="buyAmount" template="layout/display.xhtml">
							<ui:define name="label">Buy-price</ui:define>
							<h:outputText value="#{inventoryHome.instance.buyAmount}">
								<f:convertNumber />
							</h:outputText>
						</s:decorate>

						<s:decorate id="sellAmount" template="layout/display.xhtml">
							<ui:define name="label">Sell-price</ui:define>
							<h:outputText value="#{inventoryHome.instance.sellAmount}">
								<f:convertNumber />
							</h:outputText>
						</s:decorate>

						<s:decorate id="totalAmount" template="layout/display.xhtml">
							<ui:define name="label">Total spend</ui:define>
							<h:outputText value="#{inventoryHome.instance.totalAmount}">
								<f:convertNumber />
							</h:outputText>
						</s:decorate>
						<s:decorate id="note" template="layout/display.xhtml">
							<ui:define name="label">Note</ui:define>
							<h:outputText value="#{inventoryHome.instance.note}" />
						</s:decorate>

						<div style="clear: both" />

					</rich:panel>
				</h:panelGroup>
			</h:panelGrid>
		</rich:panel>

		<div class="actionButtons"><s:button view="/InventoryEdit.xhtml"
			id="edit" value="Edit" /> <s:button
			view="/#{empty inventoryFrom ? 'InventoryList' : inventoryFrom}.xhtml"
			id="done" value="Done" /></div>
	</ui:define>

</ui:composition>
